<h1><font color="a3bc3fc" size = "6"> <%= t :dshinhanhnuoc%></font></h1>

<table class="table table-striped">
  <tr>
  </tr>

<% @product_images.each do |product_image| %>
  <tr>
    <% @product= Product.find(product_image.product_id) %>
    <% @des = @product.Description %>
    <% @stdes = @des.to_s %>
    <% @print = @stdes[0..150] %>
    <td><%= image_tag(product_image.image, :height => '250', :width => '250') %>  </td> 
    <td><%= @product.Name %> <br/>    
      <%=t :gia%>: <%= @product.Price %> <br/>         
      <%= t :mota%>: <%=@print%>.....<br/>
      <% product = Product.find(product_image.product_id)%>
      <%= link_to "#{t :chitiet}", product %>
    </td>
    <th></th>

    <% if((session[:user_id])!=nil) %>
      <% @user = User.find(session[:user_id]) %>
      <% if(@user.GroupUserId==10) %>
        <td><%= link_to "#{t :edit}", edit_product_image_path(product) %></td>
        <td><%= link_to "#{t :destroy}", product_image, confirm: 'Are you sure?', method: :delete %></td>
      <%end%>   
    <%end%>
    
  </tr>
<% end %>
</table>
<h6><%= will_paginate @product_images, :previous_label => t("previous"), :next_label => t("next") %></h6>
